home *** CD-ROM | disk | FTP | other *** search
- Short: Sort file containting amateur radio call signs
-
- sortham Sort an input file containing an amateur radio call sign in
- column 1. Version 1.0 05/30/92 Freeware by Vince Herried, KA8CTE.
- This version should work on AmigaDos versions 1.0 and greater.
- It has only been tested on AmigaDos V2.04.
-
- Amateur call signs are assumed to be less than 7 characters in
- length of the following format.
- PNS - where the prefix P is one or two alphabetic characters,
- where the number N is a digit from 0 to 9, and
- the suffix S is one to three characters.
-
-
- THEORY OF OPERATION
-
- The program doesn't actually sort the input lines, rather it
- sorts pointers to the input lines. Memory is allocated for
- the input file and for the pointers (one needed for each line).
-
- As the file is read in, a null character is added at the
- end of each line, thus the input buffer needs to be larger
- than the actual file size.
-
- Aztec's Manx C qsort is called with a comparison exit.
-
- The comparison exit builds a work area for each call sign
- and re-arranges it (use the above notation) NSP or number,
- suffix,prefix. It then uses a standard C compare and returns
- to the qsort exit.
-
- RESTRICTIONS
-
- Input lines longer than 255 characters are truncated.
-
- Call signs are less than seven characters long.
-
- This version requires the call sign to be in column one.
- Version two will probably allow the call sign to be embedded.
-
- Ya get what you pay for, if it don't work for you, well
- I'm sorry, it works ok for me.
-
-
- ERROR MESSAGES
-
-
- "SRTH001E: can't access FILENAME"
- Selfexplainatory, I hope. Misspelled file name?
-
- "SRTH002I - ta =%s, tb =%s"
- Debugging info, you'll never see this.
-
- "SRTH003E - open failed for FILENAME"
- Unable to open input file (read protected?)
-
- "SRTH004E - Unable to allocate memory for data buffer!"
- you don't have enough free system memory available
- to hold the input file. Try breaking the file up
- into multiple parts.
-
- "SRTH005E - Unable to allocate memory for pointer buffer!"
- sortham also needs a bunch of memory pointers.
- Maybe V2 will be a little bit smarter, this version
- assumes that each line is very short, thus if your
- data lines are more than 8 characters long it
- allocates more memory for this buffer than
- it needs. I did this rather than make multiple
- passes on the data or require you to enter an average
- line size. Try breaking the file up into multiple parts.
-
- "SRTH006E - oops it doesn't fit?"
- I guessed wrong on the size of the buffer needed for
- the input file. Probably because the file is very short
- and or all input lines are are very short eg 1x2.
- Pad one line out with text to make it longer (20 - 30
- characters should do it).
-
- "SRTH007E - oops not enough room in the pointer buffer!"
- Same problem SRTH007E. Pad a line out with text to
- make it longer.
-
-
-
-
- Address Comments to:
- Vincent Herried KA8CTE
- 1688 Staffordshire RD.
- Columbus, OH. 43229-2142
-